import {
    post,
    get
} from '../../http/axios'

export default {
    namespaced: true,
    state: {
        userInfo: [],
        num: 1,

    },
    mutations: {
        set_userInfo(state, val) {
            if (state.num == 1) {
                state.userInfo.push(val)
                state.num++
            }

        },
    },
    actions: {
        async userInfo_query(context, params) {
            let res = await get('/user/info', params);
            context.commit('set_userInfo', res.data)
        }
    }
}